<template>
  <div>
    <v-scale-screen
      width="6240"
      height="1404"
      :boxStyle="{
        backgroundColor: '#05163d',
      }"
    >
      <div class="wrapper">
        <div class="column">
          <project :areaID="areaid" @fullScreen="handleFullScreen('project')"></project>
          <commercial :areaID="areaid" @fullScreen="handleFullScreen('commercial')"></commercial>
          <guarantee :areaID="areaid" @fullScreen="handleFullScreen('guarantee')"></guarantee>
        </div>
        <div class="column">
          <mapCharts @updateAreaID="updateAreaID"></mapCharts>
        </div>
        <div class="column">
          <proportionTypes :areaID="areaid" @fullScreen="handleFullScreen('proportionTypes')"></proportionTypes>
          <occupancy-status :areaID="areaid" @fullScreen="handleFullScreen('occupancyStatus')"></occupancy-status>
          <guarantee-analysis :areaID="areaid" @fullScreen="handleFullScreen('guaranteeAnalysis')"></guarantee-analysis>
        </div>
      </div>
    </v-scale-screen>
    <a-modal
      class="full-modal"
      :visible="visibleFullScreen"
      @cancel="handleCancel"
      width="60%"
      centered
      destroyOnClose
      :footer="null"
    >
      <component :is="fullComponent" :areaID="areaid" class="full-screen" :isFullscren="isFullscren"></component>
    </a-modal>
  </div>
</template>

<script>
import project from './components/project'
import commercial from './components/commercial'
import guaranteeAnalysis from './components/guaranteeAnalysis'
import occupancyStatus from './components/occupancyStatus2'
import mapCharts from './components/map.vue'
import guarantee from './components/guarantee'
import proportionTypes from './components/proportionTypes.vue'
import { setDocumentTitle } from '@/utils/domUtil'
export default {
  name: 'DataScreen',
  components: {
    project,
    commercial,
    guarantee,
    guaranteeAnalysis,
    occupancyStatus,
    mapCharts,
    proportionTypes,
  },
  data() {
    return {
      visibleFullScreen: false,
      isFullscren: false,
      fullComponent: '',
      areaid: 0,
    }
  },
  created() {
    setDocumentTitle('住房保障智慧数据展示平台')
  },
  methods: {
    handleFullScreen(name) {
      this.visibleFullScreen = true
      this.isFullscren = true
      this.fullComponent = name
    },
    updateAreaID(id) {
      this.areaid = id
    },
    handleCancel() {
      this.visibleFullScreen = false
      this.isFullscren = false
    },
  },
}
</script>
<style lang="less" scoped>
.back {
  position: absolute;
  z-index: 999;
  top: 100px;
  left: 45%;
  /deep/ .y-button--primary {
    background-color: transparent;
  }
}
.full-modal {
  /deep/ .ant-modal-body {
    padding: 46px;
    background-color: #05163d;
  }
  /deep/ .ant-modal-close-icon {
    color: #fff;
  }
  /deep/ .full-screen {
    color: #fff;
    .anticon-fullscreen {
      display: none;
    }
  }
}
.wrapper {
  width: 6240px;
  height: 1404px;
  background-image: url(../../../assets/images/rcfbg2.png);
  background-size: 100% 100%;
  background-position: center center;
  background-repeat: no-repeat;
  display: flex;
  color: #fff;
  box-sizing: border-box;
  padding: 90px 30px 30px;
  font-size: calc(100vw * 14 / 8320);
  .column {
    flex: 1;
    min-width: 100px;
    position: relative;
    &:nth-child(2) {
      flex: 1;
      margin: 30px;
    }
  }
}
/deep/ .border-line {
  box-sizing: border-box;
  width: 100%;
  min-height: 100px;
  position: relative;
  border: 1px solid red;
  border-image: url(../../../assets/images/charts-border.png) 1 1;
  border-width: 1px;
  padding: 20px;
  margin-bottom: 20px;
}
</style>
